<template>
	<div>
		<div class="page">
			<div class="page-bd">
				<!-- 面包屑导航 -->
				<el-row type="flex" justify="space-between" class="breadcrumb">
					<div>
						<img src="~@/assets/images/programme-home.png" class="icon-home">
						<span style="margin-right: 25px;">方案设计</span>
						<span>管理方案</span>
						<span style="margin-left: 5px;margin-right: 5px;">></span>
						<span>设计方案</span>
						<span style="margin-left: 5px;margin-right: 5px;">></span>
						<span>{{ programmes[0].batch }}</span>
					</div>
					<el-row type="flex" align="middle">
						<span class="breadcrumbRight-item">{{ user.name }}</span>
						<span class="breadcrumbRight-item">{{ user.sex == 0 ? "男" : "女" }}</span>
						<span class="breadcrumbRight-item">{{ user.major == 1 ? "理工" : "文史" }}</span>
						<span class="breadcrumbRight-item" v-if="programmes[0].ranking">{{ programmes[0].ranking }}位</span>
						<span class="breadcrumbRight-item" v-if="programmes[0].fraction">{{ programmes[0].fraction }}分</span>
						<span class="breadcrumbRight-item" v-if="isgaokao">(<span>语{{user.chinese}}</span><span style="margin-left: 10px;">数{{user.manth}}</span><span style="margin-left: 10px;">综{{user.comprehensive}}</span><span style="margin-left: 10px;">外{{user.english}}</span>)</span>
						<span class="breadcrumbRight-item" @click="update()" style="color: red; cursor: pointer;">修改</span>
					</el-row>
				</el-row>
				<div class="page-block">
					<!-- input搜索区 -->
					<div class="search">
						<div class="search-cell">
							<span class="search-cell__label" style="margin-right: 15px;">院校名称</span>
							<el-autocomplete style="width: 244px;" class="search-cell__input" v-model="school"
								@blur="schoolBoolen = true" @focus="schoolBoolen = false" :fetch-suggestions="querySearch1"
								placeholder="请输入内容" :trigger-on-focus="false">
							</el-autocomplete>
						</div>
						<div class="search-cell">
							<span class="search-cell__label" style="margin-right: 15px;">专业名称</span>
							<el-autocomplete style="width: 244px;" class="search-cell__input" v-model="major"
								@blur="schoolBoolen = true" @focus="schoolBoolen = false" :fetch-suggestions="querySearch"
								placeholder="请输入内容" :trigger-on-focus="false">
							</el-autocomplete>
						</div>
					</div>
					<section class="collapse">
						<div class="chooseBlock"  :class="{ 'chooseBlock-close': collapseOpen === false }">
							<div class="chooseBlock-cell">
								<span class="chooseBlock-cell__label">所在省份</span>
								<el-checkbox-group class="modify-elCheckbox" v-model="checkedCities" ref="checkboxCities">
									<el-checkbox v-for="item in cities" style="margin-left:0; font-size: 15px; padding: 0;"
										:label="item.value" :key="item.value" @change="sfclick(item.label, $event)">{{ item.label }}
									</el-checkbox>
								</el-checkbox-group>
							</div>
							<div class="chooseBlock-cell">
								<span class="chooseBlock-cell__label">院校类型</span>
								<el-checkbox-group class="modify-elCheckbox" v-model="checkedSchoolTypes">
									<el-checkbox v-for="item in SchoolTypes" :label="item.value" :key="item.value"
										@change="schooltypeclick(item.value, $event)">{{ item.value }}</el-checkbox>
								</el-checkbox-group>
							</div>
							<div class="chooseBlock-cell">
								<span class="chooseBlock-cell__label">博硕资格</span>
								<el-checkbox-group class="modify-elCheckbox" v-model="checkedQualifications">
									<el-checkbox v-for="item in Qualifications" :label="item.value" :key="item.value"
										@change="qualificationsclick(item.value, $event)">{{ item.label }}</el-checkbox>
								</el-checkbox-group>
							</div>
							<div class="chooseBlock-cell">
								<span class="chooseBlock-cell__label">院校层级</span>
								<el-checkbox-group class="modify-elCheckbox" v-model="checkedHierarchys">
									<el-checkbox v-for="item in Hierarchys" :label="item.value" :key="item.value"
										@change="hierarchysclick(item.value, $event)">{{ item.label }}</el-checkbox>
								</el-checkbox-group>
							</div>
							<el-row type="flex">
								<div class="chooseBlock-cell" style="flex: 1; margin-bottom: 0;">
									<span class="chooseBlock-cell__label">办学性质</span>
									<el-checkbox-group class="modify-elCheckbox" v-model="checkedNatures">
										<el-checkbox v-for="item in Natures" :label="item.value" :key="item.value"
											@change="natureclick(item.value, $event)">{{ item.label }}</el-checkbox>
									</el-checkbox-group>
								</div>
							</el-row>
						</div>
						<div class="collapse-tags" v-show="collapseOpen === false" :style="collapseOpen === false && 'min-height: 40px;'">
							<template v-for="(item) in ['checkedCities', 'checkedSchoolTypes', 'checkedQualifications', 'checkedHierarchys', 'checkedNatures']">
								<el-tag v-if="checkboxTagFilter(item)" @close="resetCheckBoxItem(item)" closable>
									{{ checkboxTagFilter(item) }}
								</el-tag>
							</template>
						</div>
						<el-row class="collapse-ft" type="flex" justify="end">
							<div style="flex-shrink: 0; display: flex; align-items: center; pointer-events: auto;">
								<el-button class="modify-button" type="primary" @click="getSchool()">查询</el-button>
								<el-button class="modify-button" @click="Reset()">重置</el-button>
								<span style="margin-left: 30px; font-size: 16px; font-weight: 500; color: var(--primaryColor);">
									检索结果{{ count }}
								</span>
								<span @click="collapseOpen = !collapseOpen" style="margin-left: 120px; color: var(--primaryColor); cursor: pointer;">
									<img style="width: 17px; height: 17px; vertical-align: text-top;" :style="collapseOpen === false && 'transform: rotateX(180deg);'"
										src="~@/assets/images/programme-collapse.png" class="icon-home">
									{{ collapseOpen ? '收起' : '展开' }}
								</span>
							</div>
						</el-row>
					</section>
				</div>
				<!-- 表格区 -->
				<div style="width: 100%;margin: auto;overflow:auto" v-infinite-scroll="isLoad">
					<!-- 普通 -->
					<el-table v-show="ptfrom" class="modify-table" v-loading="loading" ref="multipleTable" :data="tableData"
						:header-cell-style="{textAlign: 'center'}" :cell-style="cellStyle">
						<el-table-column prop="sprint" label="" min-width="3px">
						</el-table-column>
						<el-table-column prop="code" label="院校代码" min-width="27px">
							<template slot-scope="props">
								<span @click="clickTable(props.row)" style="cursor: pointer;">
									{{ props.row.code }}
									<i v-show="props.isExpanded" style="color: #ccc;" class="el-icon-caret-bottom"></i>
									<i v-show="!props.isExpanded" style="color: #ccc;" class="el-icon-caret-right"></i>
								</span>
							</template>
						</el-table-column>
						<el-table-column prop="schoolName" label="院校名称">
							<template slot-scope="scope">
								<el-popover trigger="hover" placement="bottom-start">
									<p style="width: 700px;">{{scope.row.schoolDesc}}</p>
									<div slot="reference" style="cursor: pointer;font-size: 15px;">
										<span @click="details(scope.row)" style="cursor: pointer;font-size: 15px;">{{scope.row.schoolName}}</span>
									</div>
								</el-popover>
							</template>
						</el-table-column>
						<el-table-column prop="toudang2015" label="计划数|投档数">
							<el-table-column prop="toudang2019" label="2020" min-width="28px"></el-table-column>
							<el-table-column prop="toudang2020" label="2021" min-width="28px"></el-table-column>
							<el-table-column prop="toudang2021" label="2022" min-width="28px"></el-table-column>
						</el-table-column>

						<el-table-column prop="shift_line2019" label="投档线">
							<el-table-column prop="shiftLine2019" label="2020" min-width="15px"></el-table-column>
							<el-table-column prop="shiftLine2020" label="2021" min-width="15px"></el-table-column>
							<el-table-column prop="shiftLine2021" label="2022" min-width="15px"></el-table-column>
						</el-table-column>
						<el-table-column prop="ranking2019" label="投档位次">
							<el-table-column prop="ranking2019" label="2020" min-width="20px"></el-table-column>
							<el-table-column prop="ranking2020" label="2021" min-width="20px"></el-table-column>
							<el-table-column prop="ranking2021" label="2022" min-width="20px"></el-table-column>
						</el-table-column>
						<el-table-column prop="sortNum" label="综合排名" min-width="26px">
						</el-table-column>
						<el-table-column prop="schoolType" label="院校类型" min-width="28px">
						</el-table-column>
						<el-table-column prop="level" label="层级属性" min-width="26px">
						</el-table-column>
						<el-table-column prop="city" label="所在城市" min-width="26px">
						</el-table-column>
						<el-table-column prop="manager" label="主管部门" min-width="34px">
						</el-table-column>
						<el-table-column prop="majorPlan" label="录取形式" min-width="29px">
						</el-table-column>
						<el-table-column prop="plan2022" label="22计划" min-width="20px">
							<template slot-scope="scope">
								<span v-if="scope.row.plan2022 > scope.row.plan2021" class="icon-top">
									{{ scope.row.plan2022 }}<i>↑</i>
								</span>
								<span v-else-if="scope.row.plan2021 > scope.row.plan2022" class="icon-bottom">
									{{ scope.row.plan2022 }}<i>↓</i>
								</span>
								<span v-else>{{ scope.row.plan2022 }}</span>
							</template>
						</el-table-column>
						<el-table-column prop="zy" label="填报" width="90" align="center">
							<template slot-scope="scope">
								<el-dropdown trigger="click" style="margin: 0;padding: 0;">
									<span class="el-dropdown-link" :class="scope.row.schemeName ? 'scheme' : 'not-scheme'"
										style="margin: 0;cursor: pointer;font-size: 15px;">
										{{ scope.row.schemeName ? scope.row.schemeName : '请选择' }}
									</span>
									<i class="el-icon-caret-bottom"></i>
									<el-dropdown-menu slot="dropdown">
										<el-dropdown-item v-for="(item,index) in dropList" :key="index" :command="item.label"
											style="padding: 0;text-align: center;">
											<span @click="statusChange(scope.$index,item.label)"
												style="width: 60px;padding: 10px;">{{ item.label }}</span>
										</el-dropdown-item>
									</el-dropdown-menu>
								</el-dropdown>
							</template>
						</el-table-column>
						<!-- 展开后表格 -->
						<el-table-column type="expand" width="1">
							<template slot-scope="props">
								<el-table class="modify-expandTable" :data="props.row.children" style="width: 100%;font-size: 15px;"
									:header-cell-style="{textAlign: 'center'}" :cell-style="cellStyles" border>
									<el-table-column prop="majorCode" label="专业代码" min-width="13px"></el-table-column>
									<el-table-column prop="majorName" label="专业|专业等级"></el-table-column>
									<el-table-column prop="msg2015" label="计划数/录取数|最高分/平均分/最低分|最高位次-最低位次">
										<el-table-column prop="msg2015" label="2019" min-width="30px"></el-table-column>
										<el-table-column prop="msg2016" label="2020" min-width="30px"></el-table-column>
										<el-table-column prop="msg2017" label="2021" min-width="30px"></el-table-column>
									</el-table-column>
									<el-table-column prop="plan2018" label="22计划" min-width="8px">
										<template slot-scope="scope">
											<span v-if="scope.row.plan2018 > scope.row.plan2017" class="icon-top">{{ scope.row.plan2018 }}↑</span>
											<span v-else-if="scope.row.plan2017 > scope.row.plan2018" class="icon-bottom">{{ scope.row.plan2018 }}↓</span>
											<span v-else>{{ scope.row.plan2018 }}</span>
										</template>
									</el-table-column>
									<el-table-column label="操作" min-width="10px" style="padding: 0;">
										<template slot-scope="propss" style="padding: 0;">
											<el-dropdown trigger="click" style="margin: 0;padding: 0;">
												<span class="el-dropdown-link"
													style="font-size: 15px;margin: 0;color: orangered;cursor: pointer;">
													{{propss.row.sort?propss.row.sort:'专业'}}<!-- <i
														class="el-icon-arrow-down el-icon--right" v-if="!propss.row.sort"></i> -->
												</span>
												<el-dropdown-menu slot="dropdown">
													<el-dropdown-item v-for="(item,index) in majorList" :key="index"
														:command="item.label" style="padding: 0;text-align: center;">
														<span
															@click="majorchange(props.$index,propss.$index,props.row,propss.row,item.label)"
															style="width: 60px;padding: 10px;">{{ item.label }}</span>
													</el-dropdown-item>
												</el-dropdown-menu>
											</el-dropdown>
										</template>
									</el-table-column>
								</el-table>
							</template>
						</el-table-column>
					</el-table>
					<!-- 特殊 -->
					<el-table v-show="tsfrom" class="modify-table" v-loading="loading" ref="multipleTable1" :data="tableData"
						:header-cell-style="{textAlign: 'center'}" :cell-style="cellStyle2">
						<el-table-column prop="code" label="院校代码" width="95">
							<template slot-scope="props">
								<span @click="clickTable(props.row)" style="cursor: pointer;">
									{{ props.row.code }}
									<i v-show="props.isExpanded" style="color: #ccc;" class="el-icon-caret-bottom"></i>
									<i v-show="!props.isExpanded" style="color: #ccc;" class="el-icon-caret-right"></i>
								</span>
							</template>
						</el-table-column>
						<el-table-column prop="schoolName" label="院校名称">
							<template slot-scope="scope">
								<!-- <span @click="details(scope.row)" style="cursor: pointer;font-size: 12px;">{{scope.row.schoolName}}</span> -->
								<el-popover trigger="hover" placement="bottom-start">
													<p style="width: 700px;">{{scope.row.schoolDesc}}</p>
													<div slot="reference" style="cursor: pointer;font-size: 15px;">
											<span @click="details(scope.row)" style="cursor: pointer;font-size: 15px;">{{scope.row.schoolName}}</span>
													</div>
												</el-popover>
							</template>
						</el-table-column>
						<el-table-column prop="toudang2015" label="计划数|投档数">
							<el-table-column prop="toudang2019" label="2020" min-width="18px"></el-table-column>
							<el-table-column prop="toudang2020" label="2021" min-width="18px"></el-table-column>
							<el-table-column prop="toudang2021" label="2022" min-width="18px"></el-table-column>
						</el-table-column>
					
						<el-table-column prop="shift_line2019" label="平行最低分/控制线/投档最低分">
							<el-table-column prop="shiftLine2019" label="2020" min-width="30px"></el-table-column>
							<el-table-column prop="shiftLine2020" label="2021" min-width="30px"></el-table-column>
							<el-table-column prop="shiftLine2021" label="2022" min-width="30px"></el-table-column>
						</el-table-column>
						<el-table-column prop="ranking2019" label="参考位次">
							<el-table-column prop="ranking2019" label="2020" min-width="20px"></el-table-column>
							<el-table-column prop="ranking2020" label="2021" min-width="20px"></el-table-column>
							<el-table-column prop="ranking2021" label="2022" min-width="20px"></el-table-column>
						</el-table-column>
						<el-table-column prop="sortNum" label="综合排名" min-width="23px">
						</el-table-column>
						<el-table-column prop="schoolType" label="院校类型" min-width="23px">
						</el-table-column>
						<el-table-column prop="level" label="层级属性" min-width="23px">
						</el-table-column>
						<el-table-column prop="city" label="所在城市" min-width="25px">
						</el-table-column>
						<el-table-column prop="manager" label="主管部门" min-width="23px">
						</el-table-column>
						<el-table-column prop="xiancha" label="报考类别" min-width="23px">
						</el-table-column>
						<el-table-column prop="plan2022" label="22计划" min-width="19px">
							<template slot-scope="scope">
								<span v-if="scope.row.plan2022 > scope.row.plan2021" class="icon-top">
									{{ scope.row.plan2022 }}<i>↑</i>
								</span>
								<span v-else-if="scope.row.plan2021 > scope.row.plan2022" class="icon-bottom">
									{{ scope.row.plan2022 }}<i>↓</i>
								</span>
								<span v-else>{{ scope.row.plan2022 }}</span>
							</template>
						</el-table-column>
						<el-table-column prop="zy" label="填报" width="90" align="center">
							<template slot-scope="scope">
								<el-dropdown trigger="click" style="margin: 0;padding: 0;">
									<span class="el-dropdown-link" :class="scope.row.schemeName ? 'scheme' : 'not-scheme'"
										style="margin: 0;cursor: pointer;font-size: 15px;">
										{{ scope.row.schemeName ? scope.row.schemeName : '请选择' }}
									</span>
									<i class="el-icon-caret-bottom"></i>
									<el-dropdown-menu slot="dropdown">
										<el-dropdown-item v-for="(item,index) in dropList" :key="index" :command="item.label"
											style="padding: 0;text-align: center;">
											<span @click="statusChange(scope.$index,item.label)"
												style="width: 60px;padding: 10px;">{{ item.label }}</span>
										</el-dropdown-item>
									</el-dropdown-menu>
								</el-dropdown>
							</template>
						</el-table-column>
						<!-- 展开后的表格 -->
						<el-table-column type="expand" width="1">
							<template slot-scope="props">
								<el-table class="modify-expandTable" :data="props.row.children" style="width: 100%;"
									:header-cell-style="{textAlign: 'center'}" :cell-style="cellStyles" border>
									<el-table-column prop="majorCode" label="专业代码" width="95"></el-table-column>
									<el-table-column prop="majorName" label="专业|专业等级"></el-table-column>
									<el-table-column prop="msg2015" label="计划数/录取数|最高分/平均分/最低分|最高位次-最低位次">
										<el-table-column prop="msg2015" label="2019" min-width="32px"></el-table-column>
										<el-table-column prop="msg2016" label="2020" min-width="32px"></el-table-column>
										<el-table-column prop="msg2017" label="2021" min-width="32px"></el-table-column>
									</el-table-column>
									<el-table-column prop="plan2018" label="22计划" min-width="8px">
										<template slot-scope="scope">
											<span v-if="scope.row.plan2018 > scope.row.plan2017" class="icon-top">{{ scope.row.plan2018 }}↑</span>
											<span v-else-if="scope.row.plan2017 > scope.row.plan2018" class="icon-bottom">{{ scope.row.plan2018 }}↓</span>
											<span v-else>{{ scope.row.plan2018 }}</span>
										</template>
									</el-table-column>
									<el-table-column label="操作" min-width="8px" style="padding: 0;">
										<template slot-scope="propss" style="padding: 0;">
											<el-dropdown trigger="click" style="margin: 0;padding: 0;">
												<span class="el-dropdown-link"
													style="font-size:15px;margin: 0;color: orangered;cursor: pointer;">
													{{propss.row.sort?propss.row.sort:'专业'}}<!-- <i
														class="el-icon-arrow-down el-icon--right" v-if="!propss.row.sort"></i> -->
												</span>
												<el-dropdown-menu slot="dropdown">
													<el-dropdown-item v-for="(item,index) in majorList" :key="index"
														:command="item.label" style="padding: 0;text-align: center;">
														<span
															@click="majorchange(props.$index,propss.$index,props.row,propss.row,item.label)"
															style="width: 60px;padding: 10px;">{{ item.label }}</span>
													</el-dropdown-item>
												</el-dropdown-menu>
											</el-dropdown>
										</template>
									</el-table-column>
								</el-table>
							</template>
						</el-table-column>
						</el-table-column>
					</el-table>
					<!-- 提前 -->
					<el-table v-show="tqfrom" class="modify-table" v-loading="loading" ref="multipleTable2" :data="tableData"
						:header-cell-style="{textAlign: 'center'}" :cell-style="cellStyle2">
						<el-table-column prop="code" label="院校代码" width="95">
							<template slot-scope="props">
								<span @click="clickTable(props.row, props.$index)" style="cursor: pointer;">
									{{ props.row.code }}
									<i v-show="props.isExpanded" style="color: #ccc;" class="el-icon-caret-bottom"></i>
									<i v-show="!props.isExpanded" style="color: #ccc;" class="el-icon-caret-right"></i>
								</span>
							</template>
						</el-table-column>
						<el-table-column prop="schoolName" label="院校名称">
							<template slot-scope="scope">
								<!-- <span @click="details(scope.row)" style="cursor: pointer;font-size: 12px;">{{scope.row.schoolName}}</span> -->
								<el-popover trigger="hover" placement="bottom-start">
									<p style="width: 700px;">{{scope.row.schoolDesc}}</p>
									<div slot="reference" style="cursor: pointer;font-size: 15px;">
										<span @click="details(scope.row)" style="cursor: pointer;font-size: 15px;">{{scope.row.schoolName}}</span>
									</div>
								</el-popover>
							</template>
						</el-table-column>
						<el-table-column prop="toudang2015" label="计划数|投档数">
							<el-table-column prop="toudang2019" label="2020" min-width="35px"></el-table-column>
							<el-table-column prop="toudang2020" label="2021" min-width="35px"></el-table-column>
							<el-table-column prop="toudang2021" label="2022" min-width="35px"></el-table-column>
						</el-table-column>
					
						<el-table-column prop="fluctuation2019" label="最高分/平均分/最低分">
							<el-table-column prop="shiftLine2019" label="2020" min-width="36px"></el-table-column>
							<el-table-column prop="shiftLine2020" label="2021" min-width="36px"></el-table-column>
							<el-table-column prop="shiftLine2021" label="2022" min-width="36px"></el-table-column>
						</el-table-column>
						<el-table-column prop="ranking2019" label="参考位次">
							<el-table-column prop="ranking2019" label="2020" min-width="20px"></el-table-column>
							<el-table-column prop="ranking2020" label="2021" min-width="20px"></el-table-column>
							<el-table-column prop="ranking2021" label="2022" min-width="20px"></el-table-column>
						</el-table-column>
						<el-table-column prop="xiancha" label="招生类别" min-width="28px">
						</el-table-column>
						<el-table-column prop="schoolType" label="院校类型" min-width="28px">
						</el-table-column>
						<el-table-column prop="level" label="层级属性" min-width="28px">
						</el-table-column>
						<el-table-column prop="city" label="所在城市" min-width="27px">
						</el-table-column>
						<el-table-column prop="manager" label="主管部门" min-width="33px">
						</el-table-column>
						<el-table-column prop="majorPlan" label="资格线" min-width="23px">
						</el-table-column>
						<el-table-column prop="plan2022" label="22计划" min-width="23px">
							<template slot-scope="scope">
								<span v-if="scope.row.plan2022 > scope.row.plan2021" class="icon-top">
									{{ scope.row.plan2022 }}<i>↑</i>
								</span>
								<span v-else-if="scope.row.plan2021 > scope.row.plan2022" class="icon-bottom">
									{{ scope.row.plan2022 }}<i>↓</i>
								</span>
								<span v-else>{{ scope.row.plan2022 }}</span>
							</template>
						</el-table-column>
						<el-table-column prop="zy" label="填报" min-width="25px">
							<template slot-scope="scope">
								<el-dropdown trigger="click" style="margin: 0;padding: 0;">
									<span class="el-dropdown-link" style="margin: 0;color: orangered;cursor: pointer;font-size: 15px;">
										{{scope.row.schemeName?scope.row.schemeName:'志愿'}}<!-- <i
											class="el-icon-arrow-down el-icon--right" v-if="!scope.row.schemeName"></i> -->
									</span>
									<el-dropdown-menu slot="dropdown">
										<el-dropdown-item v-for="(item,index) in dropList" :key="index" :command="item.label"
											style="padding: 0;text-align: center;">
											<span @click="statusChange(scope.$index,item.label)"
												style="width: 60px;padding: 10px;">{{ item.label }}</span>
										</el-dropdown-item>
									</el-dropdown-menu>
								</el-dropdown>
							</template>
						</el-table-column>
					<el-table-column type="expand" width="1">
						<template slot-scope="props">
							<el-table class="modify-expandTable" :data="props.row.children" style="width: 100%;"
								:header-cell-style="{textAlign: 'center'}" :cell-style="cellStyles" border>
								<el-table-column prop="majorCode" label="专业代码" min-width="10px"></el-table-column>
								<el-table-column prop="majorName" label="专业|专业等级"></el-table-column>
								<el-table-column prop="msg2015" label="计划数/录取数|最高分/平均分/最低分|最高位次-最低位次">
									<el-table-column prop="msg2015" label="2019" min-width="35px"></el-table-column>
									<el-table-column prop="msg2016" label="2020" min-width="35px"></el-table-column>
									<el-table-column prop="msg2017" label="2021" min-width="35px"></el-table-column>
								</el-table-column>
								<el-table-column prop="plan2018" label="22计划" min-width="8px">
									<template slot-scope="scope">
										<span v-if="scope.row.plan2018 > scope.row.plan2017" class="icon-top">{{ scope.row.plan2018 }}↑</span>
										<span v-else-if="scope.row.plan2017 > scope.row.plan2018" class="icon-bottom">{{ scope.row.plan2018 }}↓</span>
										<span v-else>{{ scope.row.plan2018 }}</span>
									</template>
								</el-table-column>
								<el-table-column label="操作" min-width="9px" style="padding: 0;">
									<template slot-scope="propss" style="padding: 0;">
										<el-dropdown trigger="click" style="margin: 0;padding: 0;">
											<span class="el-dropdown-link"
												style="margin: 0;color: orangered;cursor: pointer;">
												{{propss.row.sort?propss.row.sort:'专业'}}<!-- <i
													class="el-icon-arrow-down el-icon--right" v-if="!propss.row.sort"></i> -->
											</span>
											<el-dropdown-menu slot="dropdown">
												<el-dropdown-item v-for="(item,index) in majorList" :key="index"
													:command="item.label" style="padding: 0;text-align: center;">
													<span
														@click="majorchange(props.$index,propss.$index,props.row,propss.row,item.label)"
														style="width: 60px;padding: 10px;">{{ item.label }}</span>
												</el-dropdown-item>
											</el-dropdown-menu>
										</el-dropdown>
									</template>
								</el-table-column>
							</el-table>
						</template>
					</el-table-column>
					</el-table>
					<div id="npt">
						<el-button style="background-color: red;" @click="saveScheme()">保存</el-button></br>
						<el-button style="background-color: green;margin-top: 20px;" @click="empty()">清空</el-button></br>
						<el-button style="background-color: orange;margin-top: 20px;" @click="handleClick()">预览</el-button>
					</div>
					
					<el-dialog title="修改信息" :visible="editFormVisibles" width="30%" :show-close="false" :close-on-click-modal="false" >
						<el-form ref="form" :model="neweditForm" label-width="80px" style="margin: auto;width: 400px;">
							<el-form-item label="位次" prop="ranking">
								<el-input v-model="neweditForm.ranking" @keydown.native="keydown($event)" @input="wchandleChange" style="width:220px"></el-input>
							</el-form-item>
							<el-form-item label="位次区间" prop="wcqj">
								上限：<el-input class="fsqj" style="width: 62px;padding: 0;" @input.native="onInput" @input="sxinput" v-model="neweditForm.maxranking"></el-input>
								~下限：<el-input class="fsqj" style="width: 62px;padding: 0;" @input.native="onInput" @input="sxinput" v-model="neweditForm.minranking"></el-input>
								<el-checkbox-group v-model="bx" size="mini" style="display: inline-block;margin-left: 10px;" id="bx" @change="bxchange">
								<el-checkbox-button :key="bx">不限</el-checkbox-button>
								</el-checkbox-group>
							</el-form-item>
							<el-form-item label="分数" prop="fraction">
								<el-input v-model="neweditForm.fraction"
									@keydown.native="keydown($event)" :max="750" style="width:220px" @input="handleChange">
								</el-input>
							</el-form-item>
							<el-form-item label="分数区间" prop="qj">
								上限：<el-input class="fsqj" style="width: 62px;padding: 0;" @input.native="onInput" @input="fssxinput" v-model="neweditForm.maxfraction"></el-input>
								~下限：<el-input class="fsqj" style="width: 62px;padding: 0;" @input.native="onInput" v-model="neweditForm.minfraction"></el-input>
								<el-checkbox-group v-model="fsbx" size="mini" style="display: inline-block;margin-left: 10px;" id="bx" @change="fsbxchange">
								<el-checkbox-button :key="fsbx">不限</el-checkbox-button>
								</el-checkbox-group>
							</el-form-item>
							<el-form-item label="方案名称" prop="name">
								<el-input v-model="neweditForm.programmeName" style="width: 220px;" @keydown.native="keydown($event)"></el-input>
							</el-form-item>
							<el-form-item>
								<el-button type="primary" @click="updateScheme()" style="margin-left: 35px;">修改</el-button>
								<el-button type="primary" @click="fqupdate()" style="margin-left: 5px;">放弃</el-button>
							</el-form-item>
						</el-form>
					
					</el-dialog>
					
					<el-dialog title="新建方案" :visible="dialogVisible" width="30%" :close-on-click-modal="false" :show-close="false">
						<p style="text-align: center;margin-bottom: 20px;">当输入位次时，系统默认用位次定位</p>
						<el-form ref="form" :model="form" label-width="80px" style="margin: auto;width: 340px;">
							<el-form-item label="*科类" prop="majorType">
								<el-select v-model="form.majorType" placeholder="请选择科类" style="width: 180px;">
									<el-option label="理工" :value="1"></el-option>
									<el-option label="文史" :value="2"></el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="*批次" prop="region">
								<el-select v-model="form.region" placeholder="请选择活动区域" style="width: 180px;">
									<el-option label="本科一批" value="本科一批"></el-option>
									<el-option label="本科二批" value="本科二批"></el-option>
									<el-option label="一批特殊" value="一批特殊"></el-option>
									<el-option label="二批特殊" value="二批特殊"></el-option>
									<el-option label="提前批A段" value="提前批A段"></el-option>
									<el-option label="提前批B段" value="提前批B段"></el-option>
									<el-option label="提前批C段" value="提前批C段"></el-option>
									<el-option label="提前批专科" value="提前批专科A段"></el-option>
									<el-option label="国家专项" value="国家专项"></el-option>
									<el-option label="地方专项" value="地方专项"></el-option>
									<el-option label="高职专科" value="高职专科"></el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="位次" prop="ranking">
								<el-input v-model="form.ranking" @keydown.native="keydown($event)" @input="wchandleChange" style="width:180px"></el-input>
							</el-form-item>
							<el-form-item label="位次区间" prop="wcqj">
								上限：<el-input class="fsqj" style="width: 42px;padding: 0;" @input.native="onInput" v-model="form.maxranking" @input="sxinput"></el-input>
								~下限：<el-input class="fsqj" style="width: 42px;padding: 0;" @input.native="onInput" v-model="form.minranking"></el-input>
								<el-checkbox-group v-model="bx" size="mini" style="display: inline-block;margin-left: 10px;" id="bx" @change="bxchange">
								<el-checkbox-button :key="bx">不限</el-checkbox-button>
								</el-checkbox-group>
							</el-form-item>
							<el-form-item label="*分数" prop="fraction">
								<el-input v-model="form.fraction" 
									@keydown.native="keydown($event)" :max="750" style="width:180px" @input="handleChange">
								</el-input>
								
							</el-form-item>
							<el-form-item label="分数区间" prop="qj">
								上限：<el-input class="fsqj" style="width: 42px;padding: 0;" @input.native="onInput" @input="fssxinput" v-model="form.maxfraction"></el-input>
								~下限：<el-input class="fsqj" style="width: 42px;padding: 0;" @input.native="onInput" v-model="form.minfraction"></el-input>
								<el-checkbox-group v-model="fsbx" size="mini" style="display: inline-block;margin-left: 10px;" id="fsbx" @change="fsbxchange">
								<el-checkbox-button :key="fsbx">不限</el-checkbox-button>
								</el-checkbox-group>
							</el-form-item>
							<el-form-item label="*方案名称" prop="name">
								<el-input v-model="form.name" style="width: 180px;" @keydown.native="keydown($event)"></el-input>
							</el-form-item>
						</el-form>
						<el-button type="primary" @click="saveSchemes()" style="margin-left: 110px;">立即创建</el-button>
						<el-button type="primary" @click="gaokao()">高考成绩</el-button>
						<el-button type="primary" @click="dwzy()" style="">上一步</el-button>
					
					</el-dialog>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import {
		request
	} from "@/util/request.js"
	const cityOptions = [
		{label:'不限',value:'不限'},{label:'陕西',value:'陕西省'},{label:'安徽',value:'安徽省'},{label:'北京',value:'北京市'},{label:'重庆',value:'重庆市'},
		{label:'福建',value:'福建省'},{label:'广东',value:'广东省'},{label:'广西',value:'广西'},{label:'甘肃',value:'甘肃省'},{label:'贵州',value:'贵州省'},
		{label:'河北',value:'河北省'},{label:'河南',value:'河南省'},{label:'海南',value:'海南省'},{label:'湖北',value:'湖北省'},{label:'湖南',value:'湖南省'},
		{label:'黑龙江',value:'黑龙江省'},{label:'吉林',value:'吉林省'},{label:'江苏',value:'江苏省'},{label:'江西',value:'江西省'},{label:'辽宁',value:'辽宁省'},
		{label:'内蒙古',value:'内蒙'},{label:'宁夏',value:'宁夏'},{label:'青海',value:'青海省'},{label:'上海',value:'上海市'},
		{label:'四川',value:'四川省'},{label:'山东',value:'山东省'},{label:'山西',value:'山西省'},{label:'天津',value:'天津市'},{label:'西藏',value:'西藏'},
		{label:'新疆',value:'新疆'},{label:'云南',value:'云南省'},{label:'浙江',value:'浙江省'},{label:'其他',value:'其他'}
	]
	const SchoolTypeOptions = [
		{label:'不限',value:'不限'},{label:'综合',value:'综合'},{label:'工科',value:'工科'},{label:'财经',value:'财经'},{label:'农业',value:'农业'},{label:'林业',value:'林业'},
		{label:'医药',value:'医药'},{label:'师范',value:'师范'},{label:'体育',value:'体育'},{label:'政法',value:'政法'},{label:'民族',value:'民族'},
		{label:'语言',value:'语言'},{label:'军事',value:'军事'},{label:'艺术',value:'艺术'},{label:'其他',value:'其他'}
	]
	const natureOptions = [
		{label:'不限',value:'不限'},{label:'公办',value:'1'},{label:'民办',value:'2'},{label:'合办',value:'3'}
	]
	const HierarchyOptions = [
		{label:'不限',value:'不限'},{label:'双一流',value:'1'},{label:'中央直管',value:'2'},{label:'985',value:'3'},{label:'211',value:'4'},{label:'双高计划',value:'5'},{label:'国家示范(骨干)',value:'6'}
	]
	const QualificationsOptions = [
		{label:'不限',value:'不限'},{label:'硕士点',value:'1'},{label:'博士点',value:'2'},{label:'研究生院',value:'3'},{label:'自划线',value:'4'},{label:'推免资格',value:'5'}
	]
	export default {
		data() {
			return {
				collapseOpen: true,
				achievementgk:null,
				gaokaocount:null,
				isgaokao:false,
				activeName: "first",
				count:null,
				bx:false,
				fsbx:false,
				ptfrom:true,
				tsfrom:false,
				tqfrom:false,
				upfs: null,
				down: null,
				neweditForm:[],
				props: {
					multiple: true
				},
				loading: true,
				editFormVisibles:false,
				value: [],
				options: [],
				schoolNames: [],
				tableData: [],
				dialogVisible: true,
				form: {
					name: '',
					region: '本科一批',
					fraction: ''
				},
				infos:{},
				drawer: false,
				index: 0,
				batch: '本科二批',
				isLoad: false,
				stuId: '',
				programmes: [],
				programmeId: "",
				Submit: 1,
				major: '',
				xfa: [],
				user: [],
				scheme: [],
				childrenData: [],
				school: '',
				cities: this.$constants.provinces,
				SchoolTypes: this.$constants.schoolTypes,
				Natures: natureOptions,
				Hierarchys: HierarchyOptions,
				Qualifications: QualificationsOptions,
				checkedCities: ['不限'],
				checkedSchoolTypes: ['不限'],
				checkedNatures: ['不限'],
				checkedHierarchys: ['不限'],
				checkedQualifications: ['不限'],
				isDisable: true,
				comeTime: 0,
				dropList: [{
						value: '1',
						label: '志愿A'
					},
					{
						value: '2',
						label: '志愿B'
					},
					{
						value: '3',
						label: '志愿C'
					},
					{
						value: '4',
						label: '志愿D'
					},
					{
						value: '5',
						label: '志愿E'
					},
					{
						value: '6',
						label: '志愿F'
					},
					{
						value: '7',
						label: '备选'
					},
					{
						value: '8',
						label: '取消'
					},
				], //志愿列表
				majorList: [{
						value: '1',
						label: '专业1'
					},
					{
						value: '2',
						label: '专业2'
					},
					{
						value: '3',
						label: '专业3'
					},
					{
						value: '4',
						label: '专业4'
					},
					{
						value: '5',
						label: '专业5'
					},
					{
						value: '6',
						label: '专业6'
					},
					{
						value: '7',
						label: '备选'
					},
					{
						value: '8',
						label: '取消'
					},
				], //专业列表
				pageObject: {
					pageNum: 1,
					pageSize: 40,
					total: 0
				},
				//表单验证
				rules: {
					fraction: [{
						required: true,
						message: '请输入分数',
						trigger: 'blur'
					}],
					region: [{
						required: true,
						message: '请选择批次',
						trigger: 'change'
					}],
					name: [{
						required: true,
						message: '请输入方案名称',
						trigger: 'blur'
					}],		
					qj: [{
						required: true,
						message: '请输入分数区间',
						trigger: 'blur'
					}],
				}
			}
		},
		methods: {
			checkboxTagFilter(value) {
				if (this[value]) {
					return this[value].filter(item => item !== '不限')
									.map(item => {
										if (['checkedNatures', 'checkedHierarchys', 'checkedQualifications'].includes(value)) {
											let arrayKey = value.replace('checked', '')
											console.log(this[arrayKey], 'value', arrayKey);
											let findVal = this[arrayKey].find(i => i.value === item)
											return findVal.label || item
										}
										return item
									})
									.join(',')
				}
				return ''
			},
			resetCheckBoxItem(dataProp) {
				this[dataProp] = ['不限']
			},
			//执行点击行调用的方法，展开和折叠行
			clickTable(row,index,e){ 
			    this.$refs.multipleTable.toggleRowExpansion(row)
				this.$refs.multipleTable1.toggleRowExpansion(row)
				this.$refs.multipleTable2.toggleRowExpansion(row)
			 },
			gaokao(){
				console.log("进来了"+this.achievementgk.totalScore)
				if(this.achievementgk.totalScore==null||this.achievementgk.totalScore==''){
					this.$message({
					          message: '高考分数为空！',
					          type: 'warning'
					        });
				}else{
					this.form.fraction=this.achievementgk.totalScore
					if(this.achievementgk.ranking!=null&&this.achievementgk.ranking!=''){
						this.form.ranking=this.achievementgk.ranking
					}
				}
			},
			fqupdate(){
				let form=JSON.parse(localStorage.getItem('updateFrom'))
				this.neweditForm=form
				this.editFormVisibles=false
			},
			dwzy(){
				this.$router.push({
					path:"/design/stuLocation"
				})
			},
			saveSchemes(){
					if(this.form.name!=null&&this.form.name!=""&&this.form.fraction!=null&&this.form.fraction!=""&&this.form.majorType!=null&&this.form.majorType!=""){
						this.scheme.push({
							"majorType":this.form.majorType,
							"programmeName": this.form.name,
							"batch": this.form.region,
							"fraction": this.form.fraction,
							"ranking": this.form.ranking,
							"minfraction":this.form.minfraction,
							"maxfraction":this.form.maxfraction,
							"minranking":this.form.minranking,
							"maxranking":this.form.maxranking,
							"stuId": this.stuId,
						})
					}else{
							this.$message({
							          message: '科类，方案名称和分数不能为空！',
							          type: 'warning'
							        });
									return;
					}
					request({
						method: 'post',
						url: 'stuScheme/saveScheme',
						data: this.scheme
					}).then(res => {
						if (res.code == 0 || res.code == 200) {
							this.$message({
								message: '保存成功！',
								type: 'success'
							});
							this.programmeId=res.data.list[0].programmeId
							this.batch=this.form.region
							this.dialogVisible=false
							this.updates(res.data.list)
						} else {
							this.$message({
								message: res.msg,
								type: 'error'
							});
						}
					})
			
			},
			fsbxchange(){
				if(this.fsbx=true){
					this.neweditForm.maxfraction=null
					this.neweditForm.minfraction=null
					this.form.maxfraction=null
					this.form.minfraction=null
				}
			},
			bxchange(){
				if(this.bx=true){
					this.neweditForm.maxranking=null
					this.neweditForm.minranking=null
					this.form.maxranking=null
					this.form.minranking=null
				}
			},
			fssxinput(value){
				if(value>750){
					this.neweditForm.maxfraction=750
				}
				if(value!=null&&value!=0){
					this.fsbx=false
				}else{
					this.fsbx=true
				}
			},
			sxinput(value){
				if(value!=null&&value!=0){
					this.bx=false
				}else{
					this.bx=true
				}
			},
			updateScheme(){
				this.neweditForm.stuId=this.user.id
				if(this.neweditForm.minfraction>this.neweditForm.maxfraction){
					this.$message({
						message:"分数区间下限不能高于上限！",
						type:'error'
					})
				}else if((this.neweditForm.ranking===null||this.neweditForm.ranking===undefined||this.neweditForm.ranking==='')&&(this.neweditForm.fraction===null||this.neweditForm.fraction===undefined||this.neweditForm.fraction==='')){
					this.$message({
						message:"分数和位次至少填写一项！",
						type:'error'
					})
				}else if(parseInt(this.neweditForm.maxranking)>parseInt(this.neweditForm.minranking)){
					this.$message({
						message:"位次区间上限不能落后于下限！",
						type:'error'
					})
				}else if(this.neweditForm.programmeName===null||this.neweditForm.programmeName===''||this.neweditForm.programmeName===undefined){
					// console.log("方案名称嘛！"+this.neweditForm.programmeName)
					this.$message({
						message:"方案名称不能为空！",
						type:'error'
					})
				}
				else{
					console.log("方案名称嘛！"+this.neweditForm.programmeName)
					if(this.neweditForm.maxfraction===0){
						this.programmes[0].minfraction=null
						this.programmes[0].maxfraction=null
					}
					request({
						method: 'POST',
						url: 'stuScheme/updateProgramme',
						data:this.neweditForm
					}).then(res => {
						this.loading=false
						if (res.code == 0 || res.code == 200) {
							this.$message({
								message: '修改成功！',
								type: 'success'
							});
							this.programmes[0].fraction=this.neweditForm.fraction
							this.programmes[0].ranking=this.neweditForm.ranking
							if(this.programmes[0].fraction==this.gaokaocount){
								this.isgaokao=true
							}
							this.getSchool()
						} else {
							this.$message({
								message: res.msg,
								type: 'error'
							});
						}
						this.editFormVisibles=false
					})
				}
				
			},
			update(){
				this.neweditForm=JSON.parse(JSON.stringify(this.programmes[0])) 
				localStorage.setItem('updateFrom',JSON.stringify(this.neweditForm))
				this.editFormVisibles=true
				// console.log(this.neweditForm)
			},
			updates(row){
				const programme = row;
				this.$router.push({
					path: '/toProgramme',
					query: {
						programme: JSON.stringify(programme)
					}
				})
			},
			onInput(e) {
				// console.log(e.target.value, "yjm")
				e.target.value = e.target.value.replace(/[^\d.]/g, '');
			},
			wchandleChange(value){
				this.neweditForm.ranking=value.replace(/[^\d.]/g, '');
				if(parseInt(value)>0){
					this.neweditForm.maxranking=Math.round(parseInt(value)-(parseInt(value)*0.2))
					this.neweditForm.minranking=Math.round(parseInt(value)+(parseInt(value)*0.6))
				}else{
					this.neweditForm.maxranking=null
					this.neweditForm.minranking=null
				}
				
				this.form.ranking=value.replace(/[^\d.]/g, '');
				if(parseInt(value)>0){
					this.form.maxranking=Math.round(parseInt(value)-(parseInt(value)*0.2))
					this.form.minranking=Math.round(parseInt(value)+(parseInt(value)*0.6))
				}else{
					this.form.maxranking=null
					this.form.minranking=null
				}
			},
			handleChange(value) {
				// console.log("进来了" + value)
				this.neweditForm.fraction = value.replace(/[^\d.]/g, '');
				if (parseInt(value) > 750) {
					this.neweditForm.fraction = 750
					value=750
					this.neweditForm.maxfraction=parseInt(value)+20
					this.neweditForm.minfraction=parseInt(value)-30
				}else{
					if(parseInt(value)<30){
						this.neweditForm.maxfraction=parseInt(value)+20
						this.neweditForm.minfraction=0
						if(value===null||value===undefined||parseInt(value)<=0||value===''||this.neweditForm===null||this.neweditForm===undefined||parseInt(this.neweditForm)<=0||this.neweditForm===''){
							this.neweditForm.maxfraction=null
							this.neweditForm.minfraction=null
						}
					}else if(parseInt(value)>=30){
						this.neweditForm.maxfraction=parseInt(value)+20
						this.neweditForm.minfraction=parseInt(value)-30
					}else{
						this.neweditForm.maxfraction=null
						this.neweditForm.minfraction=null
					}
				}
			},
			sfclick(e,t){
				// console.log("我选省份了"+t)
				// console.log("省份集合"+this.checkedCities)
				if(e==='不限'){
					this.checkedCities=['不限']
				}else if(e==='其他'){
					this.checkedCities=['其他']
				}else{
					this.checkedCities.forEach(i=>{
						if(i=='不限'||i=='其他'){
							this.checkedCities.splice(this.checkedCities.indexOf(i),1)
						}
					})
					// console.log(this.checkedCities.length)
					if(t==false&&this.checkedCities.length<1){
						this.checkedCities=['不限']
					}
				}
			},
			schooltypeclick(e,t){
				// console.log("我选院校类型了"+t)
				// console.log("院校类型集合"+this.checkedSchoolTypes)
				if(e==='不限'){
					this.checkedSchoolTypes=['不限']
				}else if(e==='其他'){
					
				}else{
					this.checkedSchoolTypes.forEach(i=>{
						if(i=='不限'||i=='其他'){
							this.checkedSchoolTypes.splice(this.checkedSchoolTypes.indexOf(i),1)
						}
					})
					// console.log(this.checkedSchoolTypes.length)
					if(t==false&&this.checkedSchoolTypes.length<1){
						this.checkedSchoolTypes=['不限']
					}
				}
			},
			natureclick(e,t){
				// console.log("我选办学性质了"+t)
				// console.log("办学性质集合"+this.checkedNatures)
				if(e==='不限'){
					this.checkedNatures=['不限']
				}else{
					this.checkedNatures.forEach(i=>{
						if(i=='不限'){
							this.checkedNatures.splice(this.checkedNatures.indexOf(i),1)
						}
					})
					// console.log(this.checkedNatures.length)
					if(t==false&&this.checkedNatures.length<1){
						this.checkedNatures=['不限']
					}
				}
			},
			hierarchysclick(e,t){
				// console.log("我选院校层级了"+t)
				// console.log("院校层级集合"+this.checkedHierarchys)
				if(e==='不限'){
					this.checkedHierarchys=['不限']
				}else{
					this.checkedHierarchys.forEach(i=>{
						if(i=='不限'){
							this.checkedHierarchys.splice(this.checkedHierarchys.indexOf(i),1)
						}
					})
					// console.log(this.checkedHierarchys.length)
					if(t==false&&this.checkedHierarchys.length<1){
						this.checkedHierarchys=['不限']
					}
				}
			},
			qualificationsclick(e,t){
				// console.log("我选博硕资格了"+t)
				// console.log("博硕资格集合"+this.checkedQualifications)
				if(e==='不限'){
					this.checkedQualifications=['不限']
				}else{
					this.checkedQualifications.forEach(i=>{
						if(i=='不限'){
							this.checkedQualifications.splice(this.checkedQualifications.indexOf(i),1)
						}
					})
					// console.log(this.checkedQualifications.length)
					if(t==false&&this.checkedQualifications.length<1){
						this.checkedQualifications=['不限']
					}
				}
			},
			querySearch(queryString, cb) {
			        var restaurants = this.options;
			        var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
			        // 调用 callback 返回建议列表的数据
			        cb(results);
			      },
			createFilter(queryString) {	
			        return (restaurant) => {
			          return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) !== -1);
			        };
			      },
			querySearch1(queryString, cb) {
			        var restaurants = this.schoolNames;
			        var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
			        // 调用 callback 返回建议列表的数据
			        cb(results);
			      },
			createFilter1(queryString) {	
			        return (restaurant) => {
			          return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) !== -1);
			        };
			      },
			szjy(value){
				this.form.ranking=value.replace(/[^\d.]/g, '');
			},
			backHistory() {
				this.$router.go(-1); //返回上一层
			},
			handleClick() {
				this.saveScheme()
				if (this.programmes != null && this.programmes.length > 0) {
					const infos = this.programmes[0];
					localStorage.setItem('volunteer', JSON.stringify(infos))
					this.$router.push({
						name: 'designPreview',
						params: {
							info: infos
						}
					})
				} else {
					const infos = this.xfa[0];
					localStorage.setItem('infos', JSON.stringify(infos))
					this.$router.push({
						name: 'designPreview',
						params: {
							info: infos
						}
					})
				}
			},
			// 禁止输入空格
			keydown(e) {
				if (e.keyCode == 32) {
					e.returnValue = false
				}
			},
			empty() {
				this.$confirm('此操作将清空所选的志愿, 是否继续?', '提示', {
					confirmButtonText: '确定',
					type: 'warning'
				}).then(() => {
					this.tableData.forEach(i => {
						i.schemeName = null
					})
					this.childrenData = []
					this.$message({
						type: 'success',
						message: '清空成功!'
					});
				})
			},
			Reset() {
				this.checkedCities = ['不限']
				this.checkedSchoolTypes = ['不限']
				this.checkedNatures = ['不限']
				this.checkedHierarchys = ['不限']
				this.checkedQualifications=['不限']
				this.major = null
				this.school = null
			},
			zyb() {
				for (let i = 0; i < this.childrenData.length; i++) {
					if (this.childrenData[i].schemeName === null || this.childrenData[i].schemeName === "") {
						this.childrenData.splice(i, 1);
					}
				}
				this.childrenData.sort((a, b) => {
					return a['schemeName'].localeCompare(b['schemeName'])
				})
				let sortList = []
				let bList = []
				for (var i = 0; i < this.childrenData.length; i++) {
					if (this.childrenData[i].schemeName == "备选") {
						bList.push(this.childrenData[i])
					} else {
						sortList.push(this.childrenData[i])
					}
				}
				bList.forEach(i => {
					sortList.push(i)
				})
				this.childrenData = sortList
				this.drawer = true
			},
			saveScheme() {
					this.zyb()
					this.scheme = []
					if (this.childrenData != undefined && this.childrenData.length > 0) {
						this.childrenData.forEach(i => {
							this.scheme.push({
								"schoolCode": i.schoolCode,
								"schoolName": i.schoolName,
								"plan2022":i.plan2022,
								"majorList": i.majorList ? JSON.stringify(i.majorList).toString() : null,
								"programmeName": this.programmes != null && this.programmes.length > 0 ? this
									.programmes[0].programmeName : this.form.name,
								"schemeName": i.schemeName,
								"programmeId": this.programmes != null && this.programmes.length > 0 ? this
									.programmes[0].programmeId : this.programmeId,
								"stuId": this.stuId,
								"batch": this.programmes != null && this.programmes.length > 0 ? this
									.programmes[0].batch : this.form.region,
								"fraction": this.programmes != null && this.programmes.length > 0 ? this
									.programmes[0].fraction : this.form.fraction,
								"ranking": this.programmes != null && this.programmes.length > 0 ? this
								.programmes[0].ranking : this.form.ranking,
								"minfraction": this.programmes != null && this.programmes.length > 0 ? this
								.programmes[0].minfraction : this.upfs,
								"maxfraction": this.programmes != null && this.programmes.length > 0 ? this
								.programmes[0].maxfraction : this.down,
								"maxranking":this.programmes[0].maxranking,
								"minranking":this.programmes[0].minranking,
								"majorPlan":i.majorPlan,
								"majorType":i.majorType
							})
						})
					} else {
							this.$message({
								message: '请至少选择一个志愿！',
								type: 'warning'
							});
							throw Error;
					}
					request({
						method: 'post',
						url: 'stuScheme/saveScheme',
						data: this.scheme
					}).then(res => {
						if (res.code == 0 || res.code == 200) {
							this.$message({
								message: '保存成功！',
								type: 'success'
							});
					
							this.programmeId = res.data.list[0].programmeId
							this.xfa = res.data.list
							this.batch = this.form.region
							// this.dialogVisible = false
							this.getSchool()
						} else {
							this.$message({
								message: res.msg,
								type: 'error'
							});
						}
					})
				

			},
			statusChange(index, val) {
				if (val == "取消") {
					for (var i = 0; i < this.childrenData.length; i++) {
						if (this.childrenData[i].schoolCode == this.tableData[index].code) {
							this.childrenData.splice(i, 1);
						}
					}
					this.tableData[index].schemeName = null
				} else {
					if (val == "备选") {
						for (var z = 0; z < this.childrenData.length; z++) {
							if (this.childrenData[z].schoolCode == this.tableData[index].code) {
								this.childrenData.splice(z, 1);
							}
						}
						this.childrenData.push({
							"schemeName": val,
							"schoolName": this.tableData[index].schoolName,
							"schoolCode": this.tableData[index].code,
							"plan2022":this.tableData[index].plan2022,
							"majorPlan":this.tableData[index].majorPlan
						})
						this.tableData[index].schemeName = val
					} else {
						if (this.childrenData.length > 0) {
							let isIn = false;
							// for (var j = 0; j < this.childrenData.length; j++) {
							// 	if (this.childrenData[j].schemeName == val) {
							// 		this.$alert(val + '已填报，如需更换，请先点击取消已选的' + val, "提示", {
							// 			showConfirmButton: false,
							// 		});
							// 		isIn = true
							// 	}

							// }
							if (!isIn) {
								for (var z = 0; z < this.childrenData.length; z++) {
									if (this.childrenData[z].schoolCode == this.tableData[index].code) {
										this.childrenData.splice(z, 1);
									}
								}
								this.childrenData.push({
									"schemeName": val,
									"schoolName": this.tableData[index].schoolName,
									"schoolCode": this.tableData[index].code,
									"plan2022":this.tableData[index].plan2022,
									"majorPlan":this.tableData[index].majorPlan
								})
								this.tableData[index].schemeName = val
							}
						} else {
							this.childrenData.push({
								"schemeName": val,
								"schoolName": this.tableData[index].schoolName,
								"schoolCode": this.tableData[index].code,
								"plan2022":this.tableData[index].plan2022,
								"majorPlan":this.tableData[index].majorPlan
							})
							this.tableData[index].schemeName = val
						}
					}

				}
			},
			majorchange(sindex, zindex, srow, zrow, label) {
				if (label == "取消") {
					for (var i = 0; i < this.childrenData.length; i++) {
						for (var j = 0; j < this.childrenData[i].majorList.length; j++) {
							if (this.childrenData[i].majorList[j].majorCode == this.tableData[sindex].children[zindex]
								.majorCode) {
								this.childrenData[i].majorList.splice(j, 1);
							}
						}
					}
					this.tableData[sindex].children[zindex].sort = null
				} else {
					if (label == "备选") {
						// console.log("选择备选了"+this.tableData[sindex])
						if (this.tableData[sindex].schemeName.length > 0) {
							for (var z = 0; z < this.childrenData.length; z++) {
								console.log("选择"+JSON.stringify(this.childrenData[z]))
								if(this.childrenData[z].majorList!=null){
									for (var x = 0; x < this.childrenData[z].majorList.length; x++) {
										if (this.childrenData[z].majorList[x].majorCode == this.tableData[sindex].children[
												zindex]
											.majorCode) {
											this.childrenData[z].majorList.splice(x, 1);
										}
									}
								}
								
							}
							this.childrenData.forEach(i => {
								if (srow.code == i.schoolCode) {
									if (!i.majorList) {
										i.majorList = []
									}
									i.majorList.push({
										"sort": label,
										"majorName": zrow.majorName,
										"majorCode": zrow.majorCode,
										"plan2018":zrow.plan2018,
										"majorLimit":zrow.majorLimit
									})
								}
							})
							this.$set(this.tableData[sindex].children[zindex], 'sort', label)
							this.tableData[sindex].children[zindex].sort = label
						} else {
							this.$message({
								message: '请先选择学校',
								type: 'error'
							});
						}
					} else {
						let sfyx=false;
						for (var l = 0; l < this.childrenData.length; l++) {
							if (this.childrenData[l].schoolCode == this.tableData[sindex].code) {
								sfyx=true;
								if (this.childrenData[l].majorList != null && this.childrenData[l].majorList.length > 0) {
									let isIn = false;
									// for (var q = 0; q < this.childrenData[l].majorList.length; q++) {
									// 	if (this.childrenData[l].majorList[q].sort == label) {
									// 		this.$alert(label + '已填报，如需更换，请先点击取消已选的' + label, "提示", {
									// 			showConfirmButton: false,
									// 		});
									// 		isIn = true
									// 	}

									// }
									if (!isIn) {
										for (var z = 0; z < this.childrenData[l].majorList.length; z++) {
											if (this.childrenData[l].majorList[z].majorCode == this.tableData[sindex]
												.children[
													zindex].majorCode) {
												this.childrenData[l].majorList.splice(z, 1);
											}
										}
										if (!this.childrenData[l].majorList) {
											this.childrenData[l].majorList = []
										}
										this.childrenData[l].majorList.push({
											"sort": label,
											"majorName": zrow.majorName,
											"majorCode": zrow.majorCode,
											"plan2018":zrow.plan2018,
											"majorLimit":zrow.majorLimit
										})
										this.$set(this.tableData[sindex].children[zindex], 'sort', label)
										this.tableData[sindex].children[zindex].sort = label
									}
								} else {
									if (this.tableData[sindex].schemeName.length > 0) {
										this.childrenData.forEach(i => {
											if (srow.code == i.schoolCode) {
												if (!i.majorList) {
													i.majorList = []
												}
												i.majorList.push({
													"sort": label,
													"majorName": zrow.majorName,
													"majorCode": zrow.majorCode,
													"plan2018":zrow.plan2018,
													"majorLimit":zrow.majorLimit
												})
											}
										})
										this.$set(this.tableData[sindex].children[zindex], 'sort', label)
										return
									} else {
										this.$message({
											message: '请先选择学校',
											type: 'error'
										});
									}
								}
							}
						}
						if(sfyx==false){
							this.$message({
								message: '请先选择学校',
								type: 'error'
							});
						}
					}
				}
			},
			details(row) {
				const infos = row;
				localStorage.setItem('infos', JSON.stringify(infos))
				const routeData=this.$router.resolve({
					name: 'school',
					params: {
						info: infos
					}
				})
				window.open(routeData.href, '_blank')
			},
			getMajor() {
				request({
					method: 'get',
					url: 'school/getMajor',
				}).then(res => {
					this.options = res.data
				})
			},
			getSchoolName() {
				request({
					method: 'post',
					url: 'school/getSchoolName',
					params:{
						majorType:this.childrenData[0].majorType,
						batch:this.batch
					}
				}).then(res => {
					this.schoolNames = res.data
				})
			},
			// 单元格的 style 的回调方法
			cellStyle2({
				row,
				column,
				rowIndex,
				columnIndex
			}) {
				if (columnIndex === 2) {
					return `textAlign:center;`;
				} else {
					if(columnIndex===1){
						if(row.sprint==="冲"){
							return 'color:red;textAlign:center;'
						}else if(row.sprint==="稳"){
							return 'color:#42d840;textAlign:center;'
						}else if(row.sprint==="保"){
							return 'color:blue;textAlign:center;'
						}
						return 'textAlign:center;'
					}else if(columnIndex===4||columnIndex===7||columnIndex===10){
					return `textAlign:center;font-weight:bold;`;
				}else{
						if(columnIndex==18){
							if(row.plan2022>row.plan2021){
								return 'color:green;textAlign:center'
							}else if(row.plan2022<row.plan2021){
								return 'color:red;textAlign:center'
							}
							return 'textAlign:center;'
						}else if(columnIndex==18&&row.schemeName!=null&&row.schemeName!=''){
							return 'background-color: #c7eaff;textAlign:center'
						}
						return 'textAlign:center;'
					}
				}
			},
			cellStyle({
				row,
				column,
				rowIndex,
				columnIndex
			}) {
				if(row.color=="red"){
					if (columnIndex === 2) {
						return `textAlign:center;`;
					} else {
						if(columnIndex===0){
							if(row.sprint==="冲"){
								return 'color:red;textAlign:center;'
							}else if(row.sprint==="稳"){
								return 'color:#42d840;textAlign:center;'
							}else if(row.sprint==="保"){
								return 'color:blue;textAlign:center;'
							}
							return 'textAlign:center;'
						}else if(columnIndex===5||columnIndex===8||columnIndex===11){
							return `textAlign:center;font-weight:bold;`;
						}else{
							if(columnIndex==22){
								if(row.plan2022>row.plan2021){
									return 'color:green;textAlign:center'
								}else if(row.plan2022<row.plan2021){
									return 'color:red;textAlign:center'
								}
								return 'textAlign:center;'
							}else if(columnIndex==23&&row.schemeName!=''&&row.schemeName!=null){
								return 'background-color: #c7eaff;textAlign:center'
							}
							return 'textAlign:center;'
						}
					}
				}else{
					if (columnIndex === 2) {
						return `textAlign:center;`;
					} else {
						if(columnIndex===0){
							if(row.sprint==="冲"){
								return 'color:red;textAlign:center;'
							}else if(row.sprint==="稳"){
								return 'color:#42d840;textAlign:center;'
							}else if(row.sprint==="保"){
								return 'color:blue;textAlign:center;'
							}
							return 'textAlign:center;'
						}else if(columnIndex===5||columnIndex===8||columnIndex===11){
							return `textAlign:center;font-weight:bold;`;
						}else{
							if(columnIndex==22){
								if(row.plan2022>row.plan2021){
									return 'color:green;textAlign:center'
								}else if(row.plan2022<row.plan2021){
									return 'color:red;textAlign:center'
								}
								return 'textAlign:center;'
							}else if(columnIndex==23&&row.schemeName!=''&&row.schemeName!=null){
								return 'background-color: #c7eaff;textAlign:center'
							}
							return 'textAlign:center;'
						}
					}
				}
				
			},
			cellStyles({
				row,
				column,
				rowIndex,
				columnIndex
			}) {
				if(row.color=="red"){
					if (columnIndex === 1) {
						return `textAlign:left;color:red`;
					} else {
						if(columnIndex==7&&row.sort!=null){
							return 'background-color: #c7eaff;textAlign:center;color:red'
						}
						return 'textAlign:center;color:red'
					}
				}else{
					if (columnIndex === 1) {
						return `textAlign:left;`;
					} else {
						if(columnIndex==7&&row.sort!=null){
							return 'background-color: #c7eaff;textAlign:center'
						}
						return 'textAlign:center'
					}
				}
				
			},
			change() {
				this.isLong = this.value.length > 3;
			},
			getSchool() {
				this.loading = true
				var hierarchys="";
				if(this.checkedHierarchys.length>0){
					for(var i=0;i<this.checkedHierarchys.length;i++){
						if(i<this.checkedHierarchys.length-1){
							hierarchys+=this.checkedHierarchys[i]+"|";
						}else{
							hierarchys+=this.checkedHierarchys[i];
						}
					}
				}		
				var qualifications="";
				if(this.checkedQualifications.length>0){
					for(var i=0;i<this.checkedQualifications.length;i++){
						if(i<this.checkedQualifications.length-1){
							qualifications+=this.checkedQualifications[i]+"|";
						}else{
							qualifications+=this.checkedQualifications[i];
						}
					}
				}
				if(this.checkedCities=='不限'){
					this.pageObject.city=[]
				}else{
					this.pageObject.city = this.checkedCities
				}
				if(this.checkedNatures=='不限'){
					this.pageObject.nature=[]
				}else{
					this.pageObject.nature = this.checkedNatures
				}
				if(this.checkedHierarchys=='不限'){
					this.pageObject.hierarchys=''
				}else{
					this.pageObject.hierarchys = hierarchys
				}
				if(this.checkedSchoolTypes=='不限'){
					this.pageObject.type=[]
				}else{
					this.pageObject.type = this.checkedSchoolTypes
				}
				if(this.checkedQualifications=='不限'){
					this.pageObject.qualifications=''
				}else{
					this.pageObject.qualifications = qualifications	
				}
				
				if(this.programmes[0].maxfraction===0){
					this.programmes[0].minfraction=null
					this.programmes[0].maxfraction=null
				}
				this.pageObject.batch = this.programmes != null && this.programmes.length > 0 ? this.programmes[0].batch :
				this.form.region
				this.pageObject.fraction=this.programmes!=null && this.programmes.length>0 ? this.programmes[0].fraction : this.form.fraction
				this.pageObject.minfraction=this.programmes!=null && this.programmes.length>0 ? this.programmes[0].minfraction :this.upfs
				this.pageObject.maxfraction=this.programmes!=null && this.programmes.length>0 ? this.programmes[0].maxfraction :this.down
				this.pageObject.majorType=this.childrenData[0].majorType
				this.pageObject.maxranking=this.programmes!=null && this.programmes.length>0 ? this.programmes[0].maxranking :this.neweditForm.maxranking
				this.pageObject.minranking=this.programmes!=null && this.programmes.length>0 ? this.programmes[0].minranking :this.neweditForm.minranking
				this.pageObject.ranking=this.programmes!=null && this.programmes.length>0 ? this.programmes[0].ranking :this.form.ranking
				this.pageObject.school=this.school
				this.pageObject.major=this.major
				const _this = this
				this.Submit = 1;
				// return
				request({
					method: 'post',
					url: 'school/getStuSchool',
					data: this.pageObject
				}).then(res => {
					res.data.list.forEach(i => i.schemeName = "")
					if (this.tableData) {
						for (var i = 0; i < res.data.list.length; i++) {
							_this.childrenData.forEach(j => {
								if (res.data.list[i].code == j.schoolCode) {
									res.data.list[i].schemeName = j.schemeName
									if(j.majorList!=null&&j.majorList!=undefined&&j.majorList!=""){
										for (var r = 0; r < j.majorList.length; r++) {
											res.data.list[i].children.forEach(o => {
												if (j.majorList[r].majorCode == o.majorCode) {
													o.sort = j.majorList[r].sort
												}
											})
										}
									}
								}
							})
						}
						this.tableData = res.data.list
						this.count=res.data.total
					} else {
						this.tableData = res.data.list
						this.count=res.data.total
					}
					this.loading = false
					
				})
			},
			scroll() {
				this.$refs.multipleTable.bodyWrapper.addEventListener('scroll', (res) => {
					let height = res.target;
					let clientHeight = height.clientHeight;
					let scrollTop = height.scrollTop;
					let scrollHeight = height.scrollHeight;
					if (clientHeight + Math.ceil(scrollTop)+1 >= scrollHeight && this.comeTime == 0 && this
						.isDisable == true) {
						
						this.comeTime = 1;
						setTimeout(() => {
							var hierarchys="";
							if(this.checkedHierarchys.length>0){
								for(var i=0;i<this.checkedHierarchys.length;i++){
									if(i<this.checkedHierarchys.length-1){
										hierarchys+=this.checkedHierarchys[i]+"|";
									}else{
										hierarchys+=this.checkedHierarchys[i];
									}
								}
							}		
							var qualifications="";
							if(this.checkedQualifications.length>0){
								for(var i=0;i<this.checkedQualifications.length;i++){
									if(i<this.checkedQualifications.length-1){
										qualifications+=this.checkedQualifications[i]+"|";
									}else{
										qualifications+=this.checkedQualifications[i];
									}
								}
							}
							
							if(this.checkedCities=='不限'){
								this.pageObject.city=[]
							}else{
								this.pageObject.city = this.checkedCities
							}
							if(this.checkedNatures=='不限'){
								this.pageObject.nature=[]
							}else{
								this.pageObject.nature = this.checkedNatures
							}
							if(this.checkedHierarchys=='不限'){
								this.pageObject.hierarchys=''
							}else{
								this.pageObject.hierarchys = hierarchys
							}
							if(this.checkedSchoolTypes=='不限'){
								this.pageObject.type=[]
							}else{
								this.pageObject.type = this.checkedSchoolTypes
							}
							if(this.checkedQualifications=='不限'){
								this.pageObject.qualifications=''
							}else{
								this.pageObject.qualifications = qualifications	
							}
							this.pageObject.major = this.major
							this.pageObject.batch = this.programmes != null && this.programmes.length > 0 ? this.programmes[0].batch :
							this.form.region
							this.pageObject.fraction=this.programmes!=null && this.programmes.length>0 ? this.programmes[0].fraction : this.form.fraction
							this.pageObject.minfraction=this.programmes!=null && this.programmes.length>0 ? this.programmes[0].minfraction :this.upfs
							this.pageObject.maxfraction=this.programmes!=null && this.programmes.length>0 ? this.programmes[0].maxfraction :this.down
							this.pageObject.majorType=this.childrenData[0].majorType
							this.pageObject.ranking=this.programmes!=null && this.programmes.length>0 ? this.programmes[0].ranking :this.form.ranking
							const Submits = {
								...this.pageObject
							}
							this.Submit = this.Submit + 1;
							Submits.pageNum = this.Submit
							this.loading=true;
							request({
								method: 'post',
								url: 'school/getStuSchool',
								data: Submits
							}).then(res => {
								res.data.list.forEach(i => i.schemeName = "")
								if (this.tableData) {
									for (var i = 0; i < res.data.list.length; i++) {
										this.childrenData.forEach(j => {
											if (res.data.list[i].code == j.schoolCode) {
												res.data.list[i].schemeName = j.schemeName
											}
										})
									}
									res.data.list.forEach(i => {
										if (this.tableData.indexOf(i) == -1) {
											this.tableData.push(i)
										}
									})
									this.count=res.data.total
								} else {
									this.tableData = res.data.list
									this.count=res.data.total
								}
								this.loading = false
								this.comeTime = 0;
							})
							this.isDisable = false
						}, 1000);
					}
					
					this.isDisable = true;

				}, true);
				this.$refs.multipleTable1.bodyWrapper.addEventListener('scroll', (res) => {
					let height = res.target;
					let clientHeight = height.clientHeight;
					let scrollTop = height.scrollTop;
					let scrollHeight = height.scrollHeight;
					if (clientHeight + Math.ceil(scrollTop)+1 >= scrollHeight && this.comeTime == 0 && this
						.isDisable == true) {
						this.comeTime = 1;
						setTimeout(() => {
							var hierarchys="";
							if(this.checkedHierarchys.length>0){
								for(var i=0;i<this.checkedHierarchys.length;i++){
									if(i<this.checkedHierarchys.length-1){
										hierarchys+=this.checkedHierarchys[i]+"|";
									}else{
										hierarchys+=this.checkedHierarchys[i];
									}
								}
							}		
							var qualifications="";
							if(this.checkedQualifications.length>0){
								for(var i=0;i<this.checkedQualifications.length;i++){
									if(i<this.checkedQualifications.length-1){
										qualifications+=this.checkedQualifications[i]+"|";
									}else{
										qualifications+=this.checkedQualifications[i];
									}
								}
							}
							
							
							if(this.checkedCities=='不限'){
								this.pageObject.city=[]
							}else{
								this.pageObject.city = this.checkedCities
							}
							if(this.checkedNatures=='不限'){
								this.pageObject.nature=[]
							}else{
								this.pageObject.nature = this.checkedNatures
							}
							if(this.checkedHierarchys=='不限'){
								this.pageObject.hierarchys=''
							}else{
								this.pageObject.hierarchys = hierarchys
							}
							if(this.checkedSchoolTypes=='不限'){
								this.pageObject.type=[]
							}else{
								this.pageObject.type = this.checkedSchoolTypes
							}
							if(this.checkedQualifications=='不限'){
								this.pageObject.qualifications=''
							}else{
								this.pageObject.qualifications = qualifications	
							}
							this.pageObject.major = this.major
							this.pageObject.batch = this.batch
							this.pageObject.majorType=this.majorType
							const Submits = {
								...this.pageObject
							}
							this.Submit = this.Submit + 1;
							Submits.pageNum = this.Submit
							this.loading=true;
							request({
								method: 'post',
								url: 'school/getStuSchool',
								data: Submits
							}).then(res => {
								res.data.list.forEach(i => i.schemeName = "")
								if (this.tableData) {
									for (var i = 0; i < res.data.list.length; i++) {
										this.childrenData.forEach(j => {
											if (res.data.list[i].code == j.schoolCode) {
												res.data.list[i].schemeName = j.schemeName
											}
										})
									}
									res.data.list.forEach(i => {
										if (this.tableData.indexOf(i) == -1) {
											this.tableData.push(i)
										}
									})
									this.count=res.data.total
								} else {
									this.tableData = res.data.list
									this.count=res.data.total
								}
								this.loading = false
							})
							this.isDisable = false
						}, 500);
					}
					this.comeTime = 0;
					this.isDisable = true;
				
				}, true);
				this.$refs.multipleTable2.bodyWrapper.addEventListener('scroll', (res) => {
					let height = res.target;
					let clientHeight = height.clientHeight;
					let scrollTop = height.scrollTop;
					let scrollHeight = height.scrollHeight;
					if (clientHeight + Math.ceil(scrollTop)+1 >= scrollHeight && this.comeTime == 0 && this
						.isDisable == true) {
						this.comeTime = 1;
						setTimeout(() => {
							var hierarchys="";
							if(this.checkedHierarchys.length>0){
								for(var i=0;i<this.checkedHierarchys.length;i++){
									if(i<this.checkedHierarchys.length-1){
										hierarchys+=this.checkedHierarchys[i]+"|";
									}else{
										hierarchys+=this.checkedHierarchys[i];
									}
								}
							}		
							var qualifications="";
							if(this.checkedQualifications.length>0){
								for(var i=0;i<this.checkedQualifications.length;i++){
									if(i<this.checkedQualifications.length-1){
										qualifications+=this.checkedQualifications[i]+"|";
									}else{
										qualifications+=this.checkedQualifications[i];
									}
								}
							}
							
							
							if(this.checkedCities=='不限'){
								this.pageObject.city=[]
							}else{
								this.pageObject.city = this.checkedCities
							}
							if(this.checkedNatures=='不限'){
								this.pageObject.nature=[]
							}else{
								this.pageObject.nature = this.checkedNatures
							}
							if(this.checkedHierarchys=='不限'){
								this.pageObject.hierarchys=''
							}else{
								this.pageObject.hierarchys = hierarchys
							}
							if(this.checkedSchoolTypes=='不限'){
								this.pageObject.type=[]
							}else{
								this.pageObject.type = this.checkedSchoolTypes
							}
							if(this.checkedQualifications=='不限'){
								this.pageObject.qualifications=''
							}else{
								this.pageObject.qualifications = qualifications	
							}
							this.pageObject.major = this.major
							this.pageObject.batch = this.batch
							this.pageObject.majorType=this.majorType
							const Submits = {
								...this.pageObject
							}
							this.Submit = this.Submit + 1;
							Submits.pageNum = this.Submit
							this.loading=true;
							request({
								method: 'post',
								url: 'school/getStuSchool',
								data: Submits
							}).then(res => {
								res.data.list.forEach(i => i.schemeName = "")
								if (this.tableData) {
									for (var i = 0; i < res.data.list.length; i++) {
										this.childrenData.forEach(j => {
											if (res.data.list[i].code == j.schoolCode) {
												res.data.list[i].schemeName = j.schemeName
											}
										})
									}
									res.data.list.forEach(i => {
										if (this.tableData.indexOf(i) == -1) {
											this.tableData.push(i)
										}
									})
									this.count=res.data.total
								} else {
									this.tableData = res.data.list
									this.count=res.data.total
								}
								this.loading = false
							})
							this.isDisable = false
						}, 500);
					}
					this.comeTime = 0;
					this.isDisable = true;
				
				}, true);

			},
			
			stopF5Refresh() {
			      document.onkeydown = function (e) {
			        var evt = window.event || e;
			        var code = evt.keyCode || evt.which;
			        //屏蔽F1---F12
			        if (code > 111 && code < 124) {
			          if (evt.preventDefault) {
			            evt.preventDefault();
			          } else {
			            evt.keyCode = 0;
			            evt.returnValue = false;
			          }
			        }
			      };
			      // //禁止鼠标右键菜单
			      // document.oncontextmenu = function () {
			      //   return false;
			      // };
			    },
			beforeunloadHandler(e) {
					e = e || window.event;
					if (e) {
						e.returnValue = "您是否确认离开此页面-页面数据可能会丢失";
					}
					return "您是否确认离开此页面-页面数据可能会丢失";
    },
	getAchievement(id){
		request({
			method: 'get',
			url: 'achievement/getAchievement',
			params: {
				stuId: id
			}
		}).then(res => {
			if(res.data!=null){
				res.data.forEach(i=>{
					 if(i.level==2){
						let gaokao=i
						this.achievementgk=i
						this.gaokaocount=Number(i.language)+Number(i.mathematics)+Number(i.foreignLanguages)+Number(i.physics)+Number(i.chemistry)+Number(i.biology)+Number(i.politics)+Number(i.history)+Number(i.geography)+Number(i.wenzong)+Number(i.comprehensive)
						console.log("高考成绩"+this.gaokaocount+"现在"+this.programmes[0].fraction)
						if(this.gaokaocount==this.programmes[0].fraction){
							this.isgaokao=true
						}
					}
				})
			}
		})
	},
		},
		mounted() {
			setTimeout(this.scroll(), 2000)
			window.addEventListener("beforeunload", (e) => {
				this.beforeunloadHandler(e);
			});

			this.$once('hook:beforeDestroy', () => {
				window.removeEventListener("beforeunload", (e) => {
					this.beforeunloadHandler(e);
				});
			})
		},
		created() {
			this.stopF5Refresh();
			if (JSON.parse(this.$route.query.programme != null)) {
				this.dialogVisible=false
				this.programmes = JSON.parse(this.$route.query.programme)
				this.childrenData = [...this.programmes]
				if(this.programmes[0].minfraction===0||this.programmes[0].minfraction==="0"||this.programmes[0].minfraction===null){
					this.programmes[0].minfraction=null
					this.fsbx=true
				}else if(this.programmes[0].maxfraction===0||this.programmes[0].maxfraction==="0"||this.programmes[0].maxfraction===null){
					this.programmes[0].maxfraction=null
					this.fsbx=true
				}
				if(this.programmes[0].minranking==="0"||this.programmes[0].minranking===0||this.programmes[0].minranking===null){
					this.programmes[0].minranking=null
					this.bx=true
				}else if(this.programmes[0].maxranking===0||this.programmes[0].maxranking==="0"||this.programmes[0].maxranking===null){
					this.programmes[0].maxranking=null
					this.bx=true
				}
				if(this.programmes[0].batch==="提前批A段"||this.programmes[0].batch==="提前批B段"||this.programmes[0].batch==="提前批C段"||this.programmes[0].batch==="提前批专科"){
					this.tqfrom=true
					this.ptfrom=false
					this.tsfrom=false
				}else if(this.programmes[0].batch==='一批特殊'||this.programmes[0].batch==='二批特殊'){
					this.tsfrom=true
					this.tqfrom=false
					this.ptfrom=false
				}else{
					this.tsfrom=false
					this.tqfrom=false
					this.ptfrom=true
				}
			}else{
				let newlist={
						"schemeType": 1,
						"schemeChange": "0",
						"num": 1,
						"batch": "本科一批",
						"ranking": null,
						"minfraction": null,
						"maxfraction": null,
						"minranking": null,
						"maxranking": null,
						
						"plan2022": null,
						"majorPlan": null,
						"majorType": 1
			}
			this.programmes.push(newlist)
			this.childrenData=this.programmes
				this.fsbx=true
				this.bx=true
				this.tsfrom=false
				this.tqfrom=false
				this.ptfrom=true
			}
			if (this.childrenData !== undefined && this.childrenData.length > 0) {
				this.batch = this.childrenData[0].batch
				this.form.name=this.childrenData[0].programmeName
				this.form.fraction=this.childrenData[0].fraction
				if(this.childrenData[0].minfraction===0||this.childrenData[0].minfraction=='0'){
					this.childrenData[0].minfraction=null
				}else if(this.childrenData[0].maxfraction===0||this.childrenData[0].maxfraction=='0'){
					this.childrenData[0].maxfraction=null
				}
				// this.dialogVisible = false
			}
			const user = localStorage.getItem("stu");
			this.user = JSON.parse(user)
			this.getAchievement(this.user.id)
			this.getSchool()
			this.getMajor()
			this.getSchoolName()
			this.stuId=this.user.id

		}
	};
</script>

<style lang="stylus" scoped>

#npt {
	position: fixed !important;
	right: 30px;
	top: 200px;
}

#npt button {
	color: white;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	font-size: 15px;
	font-weight: initial;
	padding: 0;
	text-align: center;
}

#npt button span {
	display: inline-block;
	margin: auto;
}

.fsqj .el-input__inner{
	padding: 0;
}


createIconStyle(size, align = text-top) {
	width size
	height size
	vertical-align align
	flex-shrink 0
}
.el-icon-caret-bottom
	color #ccc
	font-size 10px
.icon-top 
	color #39B830
.icon-bottom 
	color #39B830
.icon-info 
	createIconStyle(20px)
	cursor pointer
.page 
	// font-size: 15px;
	// background: #F9F9F9;
	&-bd 
		width BodyMaxWidth
		margin 0 auto 60px auto
		// padding 32px 22px 39px 22px
		box-sizing border-box
	&-block 
		uiBlock();
		padding 20px
		margin-bottom 20px
.breadcrumb 
	font-size: 16px;
	font-weight: 400;
	color: #333333;
	padding 19px 23px 19px 23px
	.icon-home
		width 18px
		height 18px
		vertical-align: top;
		margin-right 5px
	&Right-item {
		margin-left: 10px;
	}
.modify
	&-button 
		min-width: 100px;
		padding 0 20px
		height: 40px;
		border-radius: 6px;
		font-size: 18px;
		font-weight: 400;
		& + &
			margin-left 17px
	&-row1Input /deep/ .el-input__inner
		padding 0 10px
	&-elCheckbox /deep/
		.el-checkbox
			margin-right 2px
			margin-bottom 2px
			border-radius: 6px;
			
			&.is-checked
				background: #FFF2E7;
		.el-checkbox__input 
			display none
		.el-checkbox__label
			padding 9px 21px
			color #666666
			font-size 16px
			// min-width: 70px;
			// height: 34px;
			// line-height 34px

.el-icon-caret-right
	display none
// 父表格样式
.modify-table /deep/
	border: none !important
	font-size: 16px;
	overflow: auto;
	.el-table__body tr:hover
		.el-icon-caret-right
			display inline
	thead	
		color: #666666;
	th.el-table__cell
		font-weight normal
		background #f0f0f0 !important
		border: none !important
		padding 10px 0
		& > .cell 
			padding 0
			line-height: 17px;
	th.mergeTh
		padding 10px 0 6px 0
	th.mergeTh-child
		padding 0 0 10px 0
	
	.el-table__cell
		border: none !important;
		border-bottom: 1px solid #DDDDDD !important;
		color: #333333;
		& > .cell 
			padding 0 5px
			font-weight: PingFangMedium500;
	td.el-table__expanded-cell
		padding 0
	// 展开后表格样式
	.modify-expandTable
		font-size: 16px;
		border: none !important
		th.el-table__cell
			background #FFF2E7 !important
		td.el-table__cell
			background #FFFBF8 !important
			& > .cell 
				font-weight normal
		.el-table__row:last-child td.el-table__cell
			border-bottom none !important
			border: none !important;
.search 
	padding 20px 0
	display flex
	flex-wrap wrap
	&-cell 
		display flex
		align-items center
		margin-right 31px
		&:last-child
			margin-right 0
			
		&__label 
			flex-shrink 0
			font-size: 16px;
			font-weight: 400;
			color: #333;
			line-height: 30px;
			margin-right 10px
		// &__input /deep/
		// 	.el-input__inner
		// 		height: 40px;
		// 		background: #FFFFFF;
		// 		border-color: #DDDDDD;
		// 		border-radius: 6px;
.collapse 
	position relative
	&-ft 
		position absolute
		bottom 0
		right 0
		width 100%
		pointer-events none
	&-tags 
		margin-right 528px
		/deep/ .el-tag
			margin 10px 10px 0 0
.chooseBlock
	display block
	opacity: 1;
	max-height 500px
	overflow: hidden;
	// transition: all .3s;
	&-close 
		max-height 0
	&-cell 
		display flex
		position relative
		margin-bottom 20px
		&:last-child
			margin-bottom 0
		&__label
			font-size: 16px;
			font-family: PingFang SC;
			font-weight: 400;
			color: #333;
			flex-shrink 0
			margin-right 15px
			line-height: 34px;

#t05 #npt {
	position: fixed !important;
	right: 10px;
	top: 200px;

}

#t05 #npt button {
	color: white;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	font-size: 15px;
	font-weight: initial;
	padding: 0;
	text-align: center;
}

#t05 #npt button span {
	display: inline-block;
	margin: auto;
}

.scheme{
	color: var(--primaryColor);
}
.not-scheme{
	color: #333;
}

</style>
